package list;


public class HashSetTest {

	public static void main(String[] args) {
		/*Person p1 = new Person();
		p1.name="zhangsan";
		p1.personId = "48273498237";
		p1.age=20;
		Person p2 = new Person("lisi","3478374820",21);
		Person p3 = new Person("wangwu","364827394729",23);
		Person p4 = new Person("sanyi","87236472",12);
		Set<Person> set = new HashSet<Person>();
		//List<Person> set = new ArrayList<Person>();
		set.add(p1);
		set.add(p2);
		set.add(p3);
		set.add(p4);
		System.out.println(set.size());
		p4.personId="2364872364";
		set.remove(p4);
		System.out.println(set.size());*/
		System.out.println();
		
	}
}
class Person{
	public String name;
	public String personId;
	public int age;
	
	
	public Person() {
		super();
	}
	public Person(String name, String personId, int age) {
		super();
		this.name = name;
		this.personId = personId;
		this.age = age;
	}
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((personId == null) ? 0 : personId.hashCode());
		return result;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Person other = (Person) obj;
		if (personId == null) {
			if (other.personId != null)
				return false;
		} else if (!personId.equals(other.personId))
			return false;
		return true;
	}
	
	
	
}
